<fieldset>
  <legend align="center">{{ t "select_stock" }}</legend>
  {{#if variant.track_inventory}}
    <table class="stock-levels" data-hook="stock-levels">
      <colgroup>
        <col style="width: 30%;" />
        <col style="width: 40%;" />
        <col style="width: 30%;" />
      </colgroup>
      <thead>
        <th>{{ t "name" }}</th>
        <th>{{ t "location" }}</th>
        <th>{{ t "count_on_hand" }}</th>
        <th>{{ t "quantity" }}</th>
      </thead>
      <tbody>
        {{#each variant.stock_items}}
          <tr>
            <td>{{#unless @index}}{{../../variant.name}}{{/unless}}</td>
            <td>
              {{stock_location_name}}
            </td>
            <td>
              {{count_on_hand}}
            </td>
            <td>
              <input class="quantity variant_quantity" id="quantity_{{@index}}" data-variant-id="{{../variant.id}}" data-stock-location-id="{{stock_location_id}}" type="number" min="0" value="0">
            </td>
            </tr>
        {{/each}}
      </tbody>
    </table>
  {{else}}
    <table class="stock-levels untracked-inventory" data-hook="stock-levels">
      <colgroup>
        <col style="width: 30%;" />
        <col style="width: 40%;" />
        <col style="width: 30%;" />
      </colgroup>
      <thead>
        <th>{{ t "name" }}</th>
        <th>{{ t "count_on_hand" }}</th>
        <th>{{ t "quantity" }}</th>
      </thead>
      <tbody>
        <tr>
          <td>
            {{variant.name}}
          </td>
          <td>
            No inventory necessary
          </td>
          <td>
            <input class="quantity" id="variant_quantity" data-variant-id="{{variant.id}}" type="number" min="0" value="0">
          </td>
        </tr>
      </tbody>
    </table>
  {{/if}}


  <fieldset class="no-border-bottom">
    <legend align="center" class="stock-location">
      <button class="add_variant"  title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
    </legend>
  </fieldset>
</fieldset>
